const files = ['1.png','2.jpeg','3.svg','4.jpg','5.bmp']
let res = []
for(let file of files){
    if(file.endsWith('.jpg')||file.endsWith('.jpeg')){
        res.push(file)
    }
}
console.log(res);
const path = require('path')
console.log(path.join('c:/imgs',res[0]));
console.log(path.join('c:/imgs',res[1]));
